package com.foreknow.dao.impl;

import com.foreknow.db.DBManager;
import com.foreknow.db.JdbcTemplate;
import com.foreknow.mapping.MappingFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import java.sql.Connection;

/**
 * Created by foreknow on 2022/6/27.
 */
public class BaseDao {
    public JdbcTemplate jdbcTemplate = JdbcTemplate.getInstance();
    public MappingFactory mappingFactory = MappingFactory.getInstance();
    public Log logger = LogFactory.getLog(BaseDao.class);

    /**
     * 注入数据库连接
     * @param conn
     */
    public void setConnection(Connection conn) {
        jdbcTemplate.setConnection(conn);
    }
}
